<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>在线聊天室-邀请</title>

    <meta name="author" content="冯文议·Erwin Feng"/>
    <meta name="keyword" content="在线聊天室"/>
    <meta name="description" content="在线聊天室"/>

    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <link rel="stylesheet" th:href="'/static/lib/layui/css/layui.css?v=' + ${version}">
    <link rel="stylesheet" th:href="'/static/css/invite.css?v=' + ${version}">

    <script th:src="'/static/lib/layui/layui.js?v=' + ${version}"></script>

    <script th:src="'/static/util/Variable.js?v=' + ${version}"></script>
    <script th:src="'/static/util/Utils.js?v=' + ${version}"></script>
    <script th:src="'/static/util/CacheUtils.js?v=' + ${version}"></script>
    <script th:src="'/static/util/LayerUtils.js?v=' + ${version}"></script>
    <script th:src="'/static/util/AjaxUtils.js?v=' + ${version}"></script>

    <script th:src="'/static/util/Common.js?v=' + ${version}"></script>

    <script th:inline="javascript">

        let token = [[${token}]];
        let rid = [[${rid}]];

        layui.use(function() {
            let layer = layui.layer
                , jQuery = layui.jquery;

            let error = [[${error}]];
            let msg = [[${msg}]];



            if (error) {

                layer.alert(
                    msg, {icon: 5},
                    function () {
                        window.location.href = "/";
                    });
            }


            if (isNotEmpty(token)) {
                setRoomUserAuthToken(rid, token);
            }
        });
    </script>

    <script th:src="'/static/js/invite.js?v=' + ${version}"></script>
</head>
<body>

<!--

点分享，参数：rid, 邀请者uid，邀请id，如果房间需要密码则生成token

xxx 邀请你加入 xx 房间？

取消？

加入？

如果没有昵称，需要先设置昵称 -> 确定 -> 进入房间

下次通过邀请链接不需要再提示选择

再邀请链接有效期内，都可以点链接进入

另外，如果token有效，也可以直接点房间进入哦

生成一张二维码图片

-->

<div class="main-container">
    <div class="box-title">房间邀请</div>
    <div class="box-content">
        <span th:text="${userNickname}">xxx</span>想邀请你加入《<span th:text="${roomName}">xxx</span>》房间？
    </div>
    <div class="box-btn">
        <button type="button" class="layui-btn layui-btn-primary" onclick="btnClickRefuse()">拒绝</button>
        <button type="button" class="layui-btn" onclick="btnClickJoinInRoom()">加入</button>
    </div>
</div>

<div class="layer-box">
    <div class="box-update-user">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <input type="text" name="nickname" required  lay-verify="required" placeholder="请输入昵称" autocomplete="off" class="layui-input" maxlength="20">
            </div>
            <div class="layui-form-item btn-panel">
                <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="formUpdateUser">立即提交</button>
            </div>
        </form>
    </div>
</div>


</body>
</html>